package com.slwish.xty.db;

import com.slwish.xty.entity.UserModel;

import org.litepal.crud.DataSupport;

import java.util.List;

/**
 * 登录用户数据库操作类
 * 创建人：陈浩
 * 创建时间：2017/9/25
 */

public class UserDb {
    public static UserModel query(String userId) {
        List<UserModel> list = DataSupport.where("userid = ?", userId).find(UserModel.class);
        if (null != list && list.size() > 0)
            return list.get(0);
        else return new UserModel();

    }

    public static void delete(long userId) {
        DataSupport.deleteAll(UserModel.class, "userid = ?", userId+"");

    }
}
